<template>
    <div class="equipSelectDialog">
        <el-dialog class="menuDialog" append-to-body :visible.sync="dialogVisible" :close-on-click-modal="false" center custom-class="equipSelect" @close='selectedChange(null)'>
            <span slot="title" class="dialog-footer dialogTitle">
                <span :class="{STTreeMenu: showSetParm}">{{topTilte}}</span>
                <span v-if="showSetParm">{{$t(subTitle)}}</span>
            </span>

            <div :class="{treeMenuBox: true, STTreeMenu: showSetParm}" class='contentBox'>
                <div class="title">{{$t('equipSelect.tips[2]')}}</div>
                <el-input v-if="showInput" :placeholder="$t('equipSelect.inputTips[0]')" v-model="searchName" @keyup.enter.native="onSearch" clearable>
                    <i slot="prefix" class="el-input__icon el-icon-search"></i>
                </el-input>
                <div class="datePicker">
                    <el-date-picker v-model="ECStartTime" type="date" placeholder="选择日期时间" :picker-options="pickerOptions">
                    </el-date-picker>-
                    <el-date-picker v-model="ECEndTime" type="date" placeholder="选择日期时间" :picker-options="pickerOptions">
                    </el-date-picker>
                </div>

                <!-- </el-date-picker> -->
                <div class="main">
                    <div class="treeMenu" v-loading="equipLoading">
                        <treeMenu v-if="equipList.length > 0" :needRadioCheck='true' :radioCheck='radioCheck' :dataList="equipList" :selectedMode="selectedMode" :isCloseStatus="true" :equipSelected="equipSelected" :isPage="'dialog'" :getItem="getItem" />
                        <div class="noData" v-if="equipList.length === 0">{{ $t('publics.noData') }}</div>
                    </div>
                </div>
            </div>
            <div class='contentBox'>
                <div class="title"> <span>{{$t('equipSelect.tips[3]')}}</span> <span>{{$t('publics.button.selectAll')}}<label :class="{'ivu-checkbox-inner': true, 'checkInput-active': ycpAllSelect==true}" @click.stop.prevent='changeAllSelect($event,"ycpAllSelect","yc")'></label></span></div>
                <el-input :placeholder="$t('equipSelect.inputTips[1]')" v-model="ycpSearch" clearable>
                    <i slot="prefix" class="el-input__icon el-icon-search"></i>
                </el-input>
                <div class="main" v-loading='getYxYcLoading'>
                    <div class="points">
                        <div class="point" v-for="(item,index) in ycps" @click='ycSelectChange(item)' :class='{"pointSelect":ycSelect.indexOf(item)!=-1}'>
                            {{item}}
                        </div>
                    </div>

                </div>
            </div>
            <div class='contentBox'>
                <div class="title"><span>{{$t('equipSelect.tips[4]')}}</span> <span>{{$t('publics.button.selectAll')}}<label :class="{'ivu-checkbox-inner': true, 'checkInput-active': yxpAllSelect==true}" @click.stop.prevent='changeAllSelect($event,"yxpAllSelect","yx")'></label></span></div>
                <el-input :placeholder="$t('equipSelect.inputTips[2]')" v-model="yxpSearch" clearable>
                    <i slot="prefix" class="el-input__icon el-icon-search"></i>
                </el-input>
                <div class="main" v-loading='getYxYcLoading'>
                    <div class="points">
                        <div class="point" v-for="(item,index) in yxps" @click='yxSelectChange(item)' :class='{pointSelect:yxSelect.indexOf(item)!=-1}'>
                            {{item}}
                        </div>
                    </div>

                </div>
            </div>
            <div class="equipSelectRight" v-if="showSetParm">
                <div class="setParmMain">
                    <div :class="{
                            setParm: true,
                            selectedColor: item.setNo == setParmCurrentIndex,
                        }" v-for="(item, index) in setParmList" :key="index" @click="selectedSetParm(item)">
                        {{ item.setNm }}
                    </div>
                    <div class="noData" v-if="setParmList.length === 0">{{ noData }}</div>
                </div>
                <div class="pagination">
                    <el-pagination small :page-size="setParmPageSize" layout="prev, pager, next" :total="setParmTotal" :current-page="setParmCurrentPage" @current-change="setParmHandleChange">
                    </el-pagination>
                </div>
            </div>
            <span slot="footer" class="dialog-footer">
                <el-button @click="selectedChange(null)">{{$t('publics.button.cancel')}}</el-button>
                <el-button type="primary" @click="sendData" :loading='exportLoading'>{{$t(confirmButton)}}</el-button>
            </span>
        </el-dialog>
    </div>
</template>

<style lang="scss" src="./equipSelect.scss"></style>
<script src="./equipSelect.js"></script>